use std::ptr::null_mut;

use crate::{internal::mi_page_block_size, page::_mi_malloc_generic, types::{MiHeap, MiPage}};


pub unsafe fn _mi_page_malloc_zeroed(heap: *mut MiHeap, page: *mut MiPage, size: usize) -> *mut u8 {
    _mi_page_malloc_zero(heap,page,size,true)
}

pub unsafe fn _mi_page_malloc_zero(heap: *mut MiHeap, page: *mut MiPage, size: usize, zero: bool) -> *mut u8 {
    assert!((*page).block_size == 0 || mi_page_block_size(page) >= size);
    let block = (*page).free;
    if block.is_null() {
        return _mi_malloc_generic(heap, size, zero, 0);
    }
    null_mut()
}